package com.junxonline.instant.dao.entity.model.config;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 系统数据源管理表实体类
 *
 * @author JunX
 * @date 2021-08-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "sys_data_source")
public class DataSource {

    /**
     * ID
     */
    @TableId(type = IdType.AUTO)
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long id;

    /**
     * 文件名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * URL路径
     */
    @TableField(value = "url")
    private String url;

    /**
     * 物理路径
     */
    @TableField(value = "path")
    private String path;

    /**
     * 文件后缀名
     */
    @TableField(value = "suffix")
    private String suffix;

    /**
     * 操作者
     */
    @TableField(value = "username", fill = FieldFill.INSERT)
    private String username;

    /**
     * 备份表列表
     */
    @TableField(value = "tables")
    private String tables;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    protected Date createTime;

    /**
     * 创建人
     */
    @TableField(value = "create_id", fill = FieldFill.INSERT)
    @JSONField(serializeUsing = ToStringSerializer.class)
    protected Long createId;

}
